<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Component</title>
</head>
<body>
<div id="app">
  <com-a
          :parent-msg="msg"
          :parent-num="count"
  ></com-a>
</div>

<script src="../vue.global.js"></script>
<script>
  const ComA = {
    data(){
      return{
        counter: 0,
        msg: 'child Component',
      } },
    props: ['parentMsg', 'parentNum'],
    template: `
      <h1>{{parentMsg}}</h1>
      <h2>{{parentNum}}</h2>
      <button @click="parentNum++">👍+1</button>

      <h1>{{msg}}</h1>
      <h2>{{counter}}</h2>
      <button @click="counter++">👍+1</button>
    `
  }
  const app = Vue.createApp({
    data(){
      return{
        msg: 'parent Component',
        count: 10,
      }
    },
    components: {
      'com-a': ComA
    }
  })
  const vm = app.mount('#app')
  console.log(vm)
</script>
</body>
</html>
